import Layout from '@/framework/layout'
import { constantRoutes as appConstantRoutes } from '@/app/router'

// 默认路由
export const constantRoutes = [
    {
        path: '/home',
        component: () => import('@/framework/views/login/home.vue'),
        hidden: true
    },
    {
        path: '/login',
        component: () => import('@/framework/views/login'),
        hidden: true
    },
    {
        path: '/clogin',
        component: () => import('@/framework/views/login/customer.vue'),
        hidden: true
    },
    {
        path: '/404',
        component: () => import('@/framework/views/404'),
        hidden: true
    },

    {
        path: '/',
        component: Layout,
        redirect: '/search/search',
        meta: { title: "花型检索管理", icon: "el-icon-search" },
        children: [
            {
                path: "search",
                name: "Search",
                meta: { title: "花型检索" },
                component: () => import("@/app/views/search/search"),
              },]
    },


    {
          path: "/search",
          component: Layout,
          name: "Search",
          alwaysShow: true,
          hidden: true,
          redirect: "/search/search",
          meta: { title: "花型检索管理", icon: "el-icon-search" },
          children: [
            {
              path: "search",
              name: "Search",
              meta: { title: "花型检索" },
              component: () => import("@/app/views/search/search"),
            },
            {
              path: "flowerInfo/:pid/:isCart/:similarity_value",
              name: "FlowerInfoo",
              meta: { title: "花型详情" },
              component: () => import("@/app/views/flower/info"),
            
            },
          ],
        },
    ...appConstantRoutes
]
// 权限配置路由，只有超级管理员有权限
export const permissionRoutes = [
    {
        path: '/permission',
        component: Layout,
        redirect: '/permission/menu',
        name: 'PermissionSetup',
        meta: {
            title: '权限配置',
            icon: 'el-icon-open'
        },
        children: [{
            path: 'menu',
            name: 'PermissionSetupMenu',
            component: () => import('@/framework/views/permission/SetupMenu'),
            meta: { title: '菜单配置' }
        }, {
            path: 'action',
            name: 'PermissionSetupAction',
            component: () => import('@/framework/views/permission/SetupAction'),
            meta: { title: '接口配置' },
            hidden:true
        },{
            path: 'role',
            name: 'PermissionRole',
            component: () => import('@/framework/views/permission/Role'),
            meta: { title: '角色管理' }
        }]
    }
]

// 通配符路由，必须放最后，所以分开
export const lastRoutes = [
    { path: '*', redirect: '/404', hidden: true }
]